#ifndef RP2WATEREFFECT_H
#define RP2WATEREFFECT_H

#include "Rp2ShaderEffect.h"

namespace Rp2
{

class WaterEffect : public ShaderEffect
{
	RP2_DECLARE_RTTI;
	RP2_DECLARE_NAME_ID;

public:
	WaterEffect(const char* acBumpName, const char* acWaterName,
        const char* acEnvName);
	virtual ~WaterEffect();

    void SetLightDir (const Vector3f& rkValue);
    Vector3f GetLightDir () const;

    void SetWaveDirX (float afValue[4]);
    void GetWaveDirX (float afValue[4]) const;
    void SetWaveDirY (float afValue[4]);
    void GetWaveDirY (float afValue[4]) const;
    void SetWaveSpeed (float afValue[4]);
    void GetWaveSpeed (float afValue[4]) const;
    void SetWaveOffset (float afValue[4]);
    void GetWaveOffset (float afValue[4]) const;
    void SetWaveHeight (float afValue[4]);
    void GetWaveHeight (float afValue[4]) const;
    void SetBumpSpeed (float afValue[4]);
    void GetBumpSpeed (float afValue[4]) const;

    void SetAverageDuDxDvDy (float fValue);
    float GetAverageDuDxDvDy () const;
    void SetAmbient (float fValue);
    float GetAmbient () const;
    void SetTextureRepeat (float fValue);
    float GetTextureRepeat () const;
    void SetTime (float fValue);
    float GetTime () const;

protected:
    // The light direction is a 3-tuple.  The last component is unused.
    float m_afLightDir[4];

    // The rippling water is made up of 4 waves.
    float m_afWaveDirX[4];
    float m_afWaveDirY[4];
    float m_afWaveSpeed[4];
    float m_afWaveOffset[4];
    float m_afWaveHeight[4];
    float m_afBumpSpeed[4];

    // Index 0 is averageDuDxDvDy, index 1 is ambient, index 2 is
    // texture repeat, and index 3 is time.
    float m_afConstants[4];
};

typedef Pointer<WaterEffect> WaterEffectPtr;
#include "Rp2WaterEffect.inl"
}

#endif